﻿package 
{
	import flash.display.MovieClip;
	import events.AssetsEvent;
	import flash.display.Sprite;

	public class Main extends Sprite
	{
		private var m_startTime:int;
		private var m_n:int = 0;
		
		public function Main()
		{
			var t_assetsManager:AssetsManager = AssetsManager.GetInstance();
			t_assetsManager.loadImage("../res/good.jpg");
			t_assetsManager.addEventListener(AssetsEvent.IMAGE_LOADED_COMPLETE, loadedHandler);
			t_assetsManager.loadSwf("../res/Test01.swf");
			t_assetsManager.addEventListener(AssetsEvent.SWF_LOADED_COMPLETE, swfLoadedHandler);
		}
		private function swfLoadedHandler(e:AssetsEvent):void
		{
			trace("[Main] --> swf loaded");
			var t_test:MovieClip = AssetsManager.GetInstance().getAssetByClass("maliu_MC") as MovieClip;
			if(t_test)
			{
				this.addChild(t_test);
			}
		}
		private function loadedHandler(e:AssetsEvent):void
		{
			trace("[Main] --> image loaded");
//			if(e.cachePolicy == AssetsEvent.POLICY_CACHE_BITMAPDATA && e.loadedData != null)
//			{
//				
//			}
		}
	}
}
